﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserName"] == null)
        {
            PanelLogin.Visible = true;

            lbl_Message.Text = "";
        }
        else
        {
            PanelLogin.Visible = false;
        }
    }
    protected void btn_Login_Click(object sender, EventArgs e)
    {
        if (txt_UserName.Text == "dunglq1" & txt_Password.Text == "dunglq123")
        {
            Session["UserName"] = txt_UserName.Text;

            if (Request.QueryString["path"] == null)
            {
                Response.Redirect("Default.aspx");
            }
            else
            {
                Response.Redirect(Request.QueryString["path"]);
            }

            lbl_Message.Text = "";
        }
        else
        {
            lbl_Message.Text = "Mật khẩu sai!";
            txt_UserName.Text = "";
            txt_Password.Text = "";
        }
    }
}